package com.atguigu.pojo;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/12/16 19:47
 * @注释
 */
public class Student {
    private Integer id;

    private String name;

    private Integer age;

    private String gender;

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        System.out.println("2.依赖注入");
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Student() {
        System.out.println("1.创建对象");
    }

    private void init() {
        System.out.println("3.初始化");
    }

    private void destroy() {
        System.out.println("5.销毁");
    }
}
